Image processing method and device

ABSTRACT

Embodiments of the present disclosure provide a method and apparatus for processing an image. An embodiment of the method includes: acquiring a two-dimensional garment image, where the two-dimensional garment image includes a style identifier of a garment; selecting a three-dimensional garment model matching the style identifier from a pre-established set of three-dimensional garment models, wherein the three-dimensional garment model includes scatter points labeled thereon; labeling the two-dimensional garment image with scatter points based on a pre-established coordinate mapping relationship between the two-dimensional garment image and the three-dimensional garment model and the scatter points of the selected three-dimensional garment model; generating a three-dimensional garment image of the acquired two-dimensional garment image based on the selected three-dimensional garment model and a result of the labeling.

The present disclosure is a U.S. National Phase Application ofInternational Application No. PCT/CN2019/085599 filed May 6, 2019, whichclaims priority to Chinese Patent Application No. “201810549444.9” filedon May 31, 2018, the entire contents of which are incorporated herein asa whole.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of computertechnology, and more particularly to a method and apparatus forprocessing an image.

BACKGROUND

Image processing is a technique for analyzing an image by using an imageprocessing device to achieve a desired result. Generally, it performsprocessing methods such as image matching, image describing, and imagerecognizing on a color image, a grayscale image, and the like acquiredby shooting by a photographing device, a scanning device, and the liketo obtain processed images.

In a conventional method for processing a three-dimensional garmentimage, generally a texture of the garment image is processed by using aconventional image processing technology to obtain a three-dimensionalgarment image.

SUMMARY

Embodiments of the present disclosure provide a method and apparatus forprocessing an image.

In a first aspect, some embodiments of the present disclosure provide amethod for processing an image, the method includes: acquiring atwo-dimensional garment image, wherein the two-dimensional garment imageincludes a style identifier of a garment; selecting a three-dimensionalgarment model matching the style identifier from a pre-established setof three-dimensional garment models, wherein the three-dimensionalgarment model includes scatter points labeled thereon; labeling thetwo-dimensional garment image with scatter points based on apre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model;generating a three-dimensional garment image of the acquiredtwo-dimensional garment image based on the selected three-dimensionalgarment model and a result of the labeling.

In some embodiments, the generating the three-dimensional garment imageof the acquired two-dimensional garment image based on the selectedthree-dimensional garment model and the result of the labelingcomprises: performing coordinate transformation on the scatter points ofthe acquired two-dimensional garment image, and determining coordinateinformation of the scatter points after the coordinate transformation;generating a primitive having a preset shape based on the coordinateinformation of the scatter points after the coordinate transformation,the primitive comprising a preset number of scatter points after thecoordinate transformation and a connection relationship between thescatter points; rasterizing the primitive to obtain a fragment set ofthe primitive, wherein a fragment in the fragment set includes a colorvalue and texture coordinate information; performing texture coordinatemapping on the fragment set to obtain pixels of the selectedthree-dimensional garment model; generating the three-dimensionalgarment image based on the obtained pixels.

In some embodiments, the fragment in the fragment set further comprisetexture material information; and the generating the three-dimensionalgarment image based on the obtained pixels comprises: determiningillumination information of the obtained pixels based on the texturematerial information and the preset light source coordinate information;processing the obtained pixels based on light source color informationand the determined illumination information; generating thethree-dimensional garment image based on the processed pixels.

In some embodiments, after the generating the three-dimensional garmentimage based on the obtained pixels, the method further comprises:smoothing texture of the three-dimensional garment image.

In some embodiments, the set of three-dimensional garment models isestablished by: acquiring a set of two-dimensional sample garmentimages, the set of two-dimensional sample garment images includingtwo-dimensional sample garment image sequences of at least one style,for a two-dimensional sample garment image sequence of each style in thetwo-dimensional sample garment image sequences of at least one style,performing: extracting feature points of the two-dimensional samplegarment image sequence; constructing a fundamental matrix based on theextracted feature points; establishing a three-dimensional garment modelbased on the constructed fundamental matrix and calibration parametersof a pre-calibrated camera, wherein the camera is a camera acquiring thetwo-dimensional sample garment image sequence; generating the set ofthree-dimensional garment models based on the established at least onethree-dimensional garment model.

In some embodiments, after the generating the three-dimensional garmentimage of the acquired two-dimensional garment image, the method furthercomprises: receiving somatotype information; selecting a virtualthree-dimensional model matching the somatotype information from apreset virtual three-dimensional model set; setting, based on a presetcoordinate mapping relationship between the virtual three-dimensionalmodel and the three-dimensional garment model, the three-dimensionalgarment image onto the selected virtual three-dimensional model andpresenting.

In a second aspect, some embodiments of the present disclosure providean apparatus for processing an image, the apparatus includes: anacquisition unit, configured to acquire a two-dimensional garment image,wherein the two-dimensional garment image includes a style identifier ofa garment; a selection unit, configured to select a three-dimensionalgarment model matching the style identifier from a pre-established setof three-dimensional garment models, wherein the three-dimensionalgarment model includes scatter points labeled thereon; a labeling unit,configured to label the two-dimensional garment image with scatterpoints based on a pre-established coordinate mapping relationshipbetween the two-dimensional garment image and the three-dimensionalgarment model and the scatter points of the selected three-dimensionalgarment model; a generation unit, configured to generate athree-dimensional garment image of the acquired two-dimensional garmentimage based on the selected three-dimensional garment model and a resultof the labeling.

In some embodiments, the generation unit comprises: a coordinatetransformation subunit, configured to perform coordinate transformationon the scatter points of the acquired two-dimensional garment image, anddetermining coordinate information of the scatter points after thecoordinate transformation; a primitive generation subunit, configured togenerate a primitive having a preset shape based on the coordinateinformation of the scatter points after the coordinate transformation,the primitive comprising a preset number of scatter points after thecoordinate transformation and a connection relationship between thescatter points; a processing subunit, configured to rasterize theprimitive to obtain a fragment set of the primitive, wherein a fragmentin the fragment set includes a color value and texture coordinateinformation; a texture coordinate mapping subunit, configured to performtexture coordinate mapping on the fragment set to obtain pixels of theselected three-dimensional garment model; a generation subunit,configured to generate the three-dimensional garment image based on theobtained pixels.

In some embodiments, the fragment in the fragment set further comprisetexture material information; and the generation subunit is furtherconfigured to: determine illumination information of the obtained pixelsbased on the texture material information and the preset light sourcecoordinate information; process the obtained pixels based on lightsource color information and the determined illumination information;generate the three-dimensional garment image based on the processedpixels.

In some embodiments, the apparatus for processing an image is furtherconfigured to: smooth texture of the three-dimensional garment image.

In some embodiments, the set of three-dimensional garment models isestablished by: acquire a set of two-dimensional sample garment images,the set of two-dimensional sample garment images includingtwo-dimensional sample garment image sequences of at least one style,for a two-dimensional sample garment image sequence of each style in thetwo-dimensional sample garment image sequences of at least one style,perform: extracting feature points of the two-dimensional sample garmentimage sequence; constructing a fundamental matrix based on the extractedfeature points; establishing a three-dimensional garment model based onthe constructed fundamental matrix and calibration parameters of apre-calibrated camera, wherein the camera is a camera acquiring thetwo-dimensional sample garment image sequence; generate the set ofthree-dimensional garment models based on the established at least onethree-dimensional garment model.

In some embodiments, the apparatus for processing an image is furtherconfigured to: receive somatotype information; select a virtualthree-dimensional model matching the somatotype information from apreset virtual three-dimensional model set; set, based on a presetcoordinate mapping relationship between the virtual three-dimensionalmodel and the three-dimensional garment model, the three-dimensionalgarment image onto the selected virtual three-dimensional model andpresenting.

In a third aspect, some embodiments of the present disclosure provide aserver, the server includes: one or more processors; a storageapparatus, storing one or more programs thereon, where the one or moreprograms, when executed by the one or more processors, cause the one ormore processors to implement the method according to any one of theembodiments in the first aspect.

In a fourth aspect, some embodiments of the present disclosure provide acomputer readable storage medium, storing a computer program thereon,wherein the program, when executed by a processor, implements the methodaccording to any one of the embodiments in the first aspect.

The method and apparatus for processing an image according toembodiments of the present disclosure, by acquiring a two-dimensionalgarment image, selecting a three-dimensional garment model matching thestyle identifier from a pre-established set of three-dimensional garmentmodels, labeling the two-dimensional garment image with scatter pointsbased on a pre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model,and generating a three-dimensional garment image of the acquiredtwo-dimensional garment image based on the selected three-dimensionalgarment model and a result of the labeling, thereby the speed ofgenerating the three-dimensional garment image is increased and theaccuracy of the generated three-dimensional garment image is improved.

BRIEF DESCRIPTION OF THE DRAWINGS

Other features, objectives and advantages of the present disclosure willbecome more apparent upon reading the detailed description tonon-limiting embodiments with reference to the accompanying drawings:

FIG. 1 is a diagram of an example system architecture in whichembodiments of the present disclosure may be implemented;

FIG. 2 is a flowchart of a method for processing an image according toan embodiment of the present disclosure;

FIG. 3 is an application scenario of the method for processing an imageaccording to an embodiment of the present disclosure;

FIG. 4 is a flowchart of a method for processing an image according toanother embodiment of the present disclosure;

FIG. 5 is a schematic structural diagram of an apparatus for processingan image according to an embodiment of the present disclosure; and

FIG. 6 is a schematic structural diagram of a computer system of aserver adapted to implement embodiments of the present disclosure.

DETAILED DESCRIPTION OF EMBODIMENTS

Embodiments of present disclosure will be described below in detail withreference to the accompanying drawings. It should be appreciated thatthe specific embodiments described herein are merely used for explainingthe relevant disclosure, rather than limiting the disclosure. Inaddition, it should be noted that, for the ease of description, only theparts related to the relevant disclosure are shown in the accompanyingdrawings.

It should also be noted that the some embodiments in the presentdisclosure and some features in the disclosure may be combined with eachother on a non-conflict basis. Features of the present disclosure willbe described below in detail with reference to the accompanying drawingsand in combination with embodiments.

FIG. 1 shows an example system architecture 100 in which a method forprocessing an image or an apparatus for processing an image according toembodiments of the present disclosure may be applied.

As shown in FIG. 1, the system architecture 100 may include a terminaldevice 101, 102 or 103, a network 104, and a server 105. The network 104serves as a medium providing a communication link between the terminaldevice 101, 102 or 103, and the server 105. The network 104 may includevarious types of connections, such as wired or wireless communicationlinks, or optical cables.

A user may use the terminal device 101, 102 or 103 to interact with theserver 105 through the network 104, in order to transmit or receivemessages, etc.

The terminal devices 101, 102, and 103 may be hardware or software. Whenthe terminal devices 101, 102, and 103 are hardware, they may be variouselectronic devices that support image capturing function, including butnot limited to camera, camcorders, webcam, smart phones, tabletcomputers, and so on. When the terminal devices 101, 102 and 103 aresoftware, they may be installed in the electronic devices listed above.It may be implemented as multiple software or software module, or as asingle software or software module. This is not specifically limitedhere.

The server 105 may be a server that provides various services, forexample, the server 105 may analyze and process the data such as atwo-dimensional garment image acquired by the terminal device 101, 102,or 103, and generating a processing result (for example, athree-dimensional garment image).

It should be noted that the server 105 may be hardware, or may besoftware. When the server 105 is hardware, the server may be implementedas a distributed server cluster composed of a plurality of servers, ormay be implemented as a single server. When the server 105 is software,the server may be implemented as a plurality of software programs orsoftware modules (e.g., software programs or software modules forproviding distributed services), or may be implemented as a singlesoftware program or software module. This is not specifically limitedherein.

It should be noted that the above terminal device has specific imageprocessing function, and may process the acquired two-dimensionalgarment image and generate a three-dimensional garment image through theimage processing function. In this case a server 105 is not necessary tobe provided, and accordingly, the apparatus for processing an image maybe provided in the terminal devices 101, 102, and 103. When the server105 stores the two-dimensional garment images, the terminal devices 101,102 and 103 may not necessary to be provided, and the method forprocessing an image provided by embodiments of the present disclosuremay be executed by the server 105, and accordingly the apparatus forprocessing an image may be provided in the server 105.

It should be understood that the numbers of vehicles, networks, andservers in FIG. 1 are merely illustrative. Any number of vehicles,networks, and servers may be provided based on actual requirements.

With continued reference to FIG. 2, a flow 200 of a method forprocessing an image according to an embodiment of the present disclosureis shown. The method for processing an image includes the steps of:

Step 201, acquiring a two-dimensional garment image.

In the present embodiment, the execution body of the method forprocessing an image (for example, the server 105 shown in FIG. 1) mayacquire a two-dimensional garment image from a terminal device (forexample, the terminal devices 101, 102, or 103 shown in FIG. 1) througha wired connection or a wireless connection. The terminal deviceincludes, but is not limited to, a camera, a camcorders, a webcam, asmartphone, a tablet computer, and the like. Here, the two-dimensionalgarment image may be acquired locally by the execution body. Thetwo-dimensional garment image may include a coat garment image, a pantsgarment image, a T-shirt garment image, and the like. In general,garments may include various categories, such as jeans, sports pants,wind-breaker, down clothes, and the like, and garments of the samecategory may include various different styles, and garments of the samestyle may include different colors, patterns, and the like. Here,garments of the same style and different colors may be provided with thesame style identifier in advance. When acquiring the two-dimensionalgarment image, the execution body may further acquire the styleidentifier of the garment presented by the two-dimensional garmentimage. The style identifier may include text for describing a garmentstyle, and may also include numbers, letters, strings, and the like.

At step 202, selecting a three-dimensional garment model matching thestyle identifier from a pre-established set of three-dimensional garmentmodels.

In the present embodiment, the above execution body may pre-establish aset of three-dimensional garment models. The set of three-dimensionalgarment models may be provided with three-dimensional garment models ofdifferent styles. A three-dimensional garment model may be created basedon the style features of garments of a certain style. Here, thethree-dimensional garment model is a mesh three-dimensional garmentmodel created based on a three-dimensional reconstruction technique.Thus, garments of the same style but of different textures may becharacterized by the same three-dimensional garment model. Texturegenerally refers to the color on an object and may also refer to thesurface roughness of the object, and it is typically represented bycolor values. Each three-dimensional garment model may be provided witha style identifier. With the style identifier, the above-describedexecution body may select, from the set of three-dimensional garmentmodels, a three-dimensional garment model matching the garment presentedby the acquired two-dimensional garment image. Here, the styleidentifier may include text for describing a garment style, and may alsoinclude numbers, letters, character strings, or the like, which may berepresented in the same manner as the style identifier included in thetwo-dimensional garment image. Thus, the above-described execution bodymay select a three-dimensional garment model having the same style asthe garment presented by the acquired two-dimensional garment image fromthe pre-established set of three-dimensional garment models. Athree-dimensional garment model in the set of three-dimensional garmentmodels described above may also include labeled scatter points. Here,the scatter points may be points manually labeled on thethree-dimensional garment model, or may be points pre-generated by theabove-mentioned execution body. By labeling scatter points on thethree-dimensional garment model, the speed at which the garment imagetexture is mapped onto the three-dimensional garment model may beincreased. The scatter point information of a scatter point may include,for example, object coordinate information or the like. The objectcoordinates are generally coordinates with the center of the object asthe coordinate origin. The set of three-dimensional garment modelsdescribed above may be created based on different styles of garments tobe created by using existing three-dimensional model creationtechniques, such as Autodesk Maya model creation software.

In some alternative implementations of the present embodiment, the setof three-dimensional garment models described above may also beestablished by:

First, the execution body may acquire a set of two-dimensional samplegarment images. Here, the set of two-dimensional sample images includestwo-dimensional sample garment image sequences of at least one style.Here, the two-dimensional sample garment image sequence may include afront-side two-dimensional sample garment image of the sample garment, areverse-side two-dimensional sample garment image of the sample garment,and the like.

Then, for a two-dimensional sample garment image sequence of each stylein the two-dimensional sample garment image sequences of at least onestyle, the execution body may perform the step of: first extractingfeature points of the two-dimensional sample garment image sequence.Here, a feature point may be a point in the image where the brightnesschanges drastically or a point with a maximum curvature on the edgecurve of the image, the feature point has a significant difference fromthe surrounding adjacent points. The feature point extraction method maybe performed using an existing SIFT (Scale-invariant feature transform)algorithm. Next, constructing a fundamental matrix based on theextracted feature points using a linear method. Then determining aprojection matrix based on the camera based on pre-calibrated cameracalibration parameters. So that the three-dimensional garment model isobtained by the constructed fundamental matrix and the projection matrixof the camera. Here, the pre-calibrated camera is a camera that acquiresthe two-dimensional sample garment image sequence. The camera has beencalibrated when the two-dimensional sample garment image sequence isacquired.

Finally, the set of three-dimensional garment models are generated byestablishing at least one three-dimensional garment model.

Step 203: labeling the two-dimensional garment image with scatter pointsbased on a pre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model.

In the present embodiment, the above-described execution body maypre-establish the coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment model.As an example, the coordinate mapping relationship may be establishedby: first performing texture segmentation on the three-dimensionalgarment model using existing surface texture segmentation techniques.The three-dimensional garment model is a three-dimensional model whichis mesh like and labeled with scatter points and texture hasn't beenmapped thereon. Therefore, after texture segmentation is performed onthe three-dimensional garment model, the obtained texture plane map ofthe three-dimensional garment model is a scatter point map. Next,establishing a mapping relationship between the obtained scatter pointmap and the three-dimensional garment model. This mapping relationshipis the coordinate mapping relationship between the two-dimensionalgarment image and the three-dimensional garment model.

In the present embodiment, the above-described execution body may labelthe acquired two-dimensional garment image with scatter points based onthe pre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment model.As an example, based on the coordinate information of the scatter pointson the scatter point map of the selected three-dimensional garmentmodel, the coordinate information being in the two-dimensional plane,the above-described execution body may label the acquiredtwo-dimensional garment image at the positions corresponding thereto.

Step 204: generating a three-dimensional garment image of the acquiredtwo-dimensional garment image based on the selected three-dimensionalgarment model and a result of the labeling.

In the present embodiment, based on the labeling result of thetwo-dimensional garment image in step 203, the above-described executionbody may determine the color values, gray values, and the like at thescatter points on the labeled two-dimensional garment image. The colorvalues and the gray values are set, through the pre-establishedcoordinate mapping relationship between the two-dimensional garmentimage and the three-dimensional garment model, at corresponding labeledscatter points on the selected three-dimensional garment model. And thecolor values, gray values between the scatter points are obtained byinterpolating the scatter points by using an existing interpolationalgorithm technology. Thus, a three-dimensional garment image of theacquired two-dimensional garment image is generated based on the colorvalues and the gray values at the points on the acquiredthree-dimensional garment model.

With continued reference to FIG. 3, FIG. 3 is a schematic diagram of anapplication scene of the method for processing an image according to thepresent embodiment. In the application scenario of FIG. 3, after theserver 301 acquires the two-dimensional garment image with the styleidentifier “shirt”, a three-dimensional garment model 302 matching the“shirt” may be selected from the pre-established set ofthree-dimensional garment models Here, the three-dimensional garmentmodel 302 is a mesh three-dimensional model with no texture map addedthereon. The three-dimensional garment model also includes labeledscatter points. Then, the server 301 may label the acquiredtwo-dimensional garment image with scatter points according to thecoordinate mapping relationship between the pre-establishedthree-dimensional garment model 302 and the acquired two-dimensionalgarment image and the scatter points of the three-dimensional garmentmodel 302. Reference numeral 303 is the two-dimensional garment image ofthe “shirt” that has been labeled with scatter points. Finally, thethree-dimensional garment image 304 of the acquired two-dimensionalgarment image is generated based on the result of labeling scatterpoints on the two-dimensional garment image of the “shirt” and thethree-dimensional garment model 302.

According to the method and apparatus for processing an image providedin embodiments of the present invention, by acquiring a two-dimensionalgarment image, selecting a three-dimensional garment model matching thestyle identifier from a pre-established set of three-dimensional garmentmodels, then labeling the two-dimensional garment image with scatterpoints based on a pre-established coordinate mapping relationshipbetween the two-dimensional garment image and the three-dimensionalgarment model and the scatter points of the selected three-dimensionalgarment model, and finally generating a three-dimensional garment imageof the acquired two-dimensional garment image based on the selectedthree-dimensional garment model and a result of the labeling thereby thespeed of generating the three-dimensional garment image is increased andthe accuracy of the generated three-dimensional garment image isimproved.

With continued reference to FIG. 4, a flow 400 of a method forprocessing an image according to another embodiment of the presentdisclosure is shown. The method for processing an image includes thesteps of:

Step 401: acquiring a two-dimensional garment image.

In the present embodiment, the execution body of the method forprocessing an image (for example, the server 105 shown in FIG. 1) mayacquire a two-dimensional garment image from a terminal device (forexample, the terminal devices 101, 102, 103 shown in FIG. 1) through awired connection or a wireless connection. Here, the two-dimensionalgarment image may be acquired locally by the execution body. Thetwo-dimensional garment image may include a coat garment image, a pantsgarment image, a T-shirt garment image, and the like. Here, garments ofthe same style and different colors may be provided with the same styleidentifier in advance. When acquiring the two-dimensional garment image,the execution body may further acquire the style identifier of thegarment presented by the two-dimensional garment image. The styleidentifier may include text for describing a clothing style, and mayalso include numbers, letters, strings, and the like.

In step 402, selecting a three-dimensional garment model matching thestyle identifier from a pre-established set of three-dimensional garmentmodels.

In the present embodiment, the above-described execution body maypre-establish a set of three-dimensional garment models. The set ofthree-dimensional garment models may be provided with three-dimensionalgarment models of different styles. Here, the three-dimensional garmentmodel is a mesh three-dimensional garment model created based on athree-dimensional reconstruction technique. Thus, garments of the samestyle but of different textures may be characterized by the samethree-dimensional garment model. Each three-dimensional garment modelmay be provided with a style identifier. With the style identifier, theabove-mentioned execution body may select, from the set ofthree-dimensional garment models, a three-dimensional garment modelmatching the garment presented by the acquired garment image. Here, thestyle identifier includes a text for describing a garment style, and mayalso include a number, a letter, a character string, or the like, whichmay be represented in the same manner as the style identifier includedin the two-dimensional garment image. The three-dimensional garmentmodel in the set of three-dimensional garment models described above mayalso include labeled scatter points. Here, the scatter point informationof a scatter point may include, for example, object coordinateinformation or the like. The object coordinates are generallycoordinates with the center of the object as the coordinate origin.

Step 403: labeling the two-dimensional garment image with scatter pointsbased on a pre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model.

In the present embodiment, the above-described execution body maypre-establish the coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment model.According to the pre-established coordinate mapping relationship betweenthe two-dimensional garment image and the three-dimensional garmentmodel, the above-described execution body may label the acquiredtwo-dimensional garment image with scatter points. Here, the informationof the scatter points of the labeled two-dimensional garment image mayinclude object coordinate information, texture information, and thelike. Here, the object coordinate information of the scatter points ofthe two-dimensional garment image is the physical coordinate informationof the labeled scatter points of the selected three-dimensional garmentmodel. Texture generally refers to the color on an object and may alsorefer to the surface roughness of the object. It is typicallyrepresented by color values. Each color value is referred to as atexture element or texture pixel. Typically, each texture pixel has aunique address in the texture. The address may be considered to be thevalue of a column and a row, represented by U and V, respectively. Thetexture coordinate is the coordinate in an object system obtained bymapping the address of the texture pixel to the object coordinatesystem. Texture processing may be performed on an object model based onthe texture coordinate information. The texture information may includetexture coordinate information, texture color information, and the like.Here, the texture information of the scatter points of thetwo-dimensional garment image may include texture element informationand texture coordinate information of the scatter points mapped to theselected three-dimensional garment model.

Step 404: performing coordinate transformation on the scatter points ofthe acquired two-dimensional garment image, and determining coordinateinformation of the scatter points after the coordinate transformation.

Based on the labeling result of the scatter points of thetwo-dimensional garment image obtained in step 403, the above-mentionedexecution body may perform coordinate transformation on the acquiredscatter points of the two-dimensional garment image. Here, thecoordinate transformation may include, for example, mapping the scatterpoints from the object coordinate system to the world coordinate systemto obtain coordinates of the scatter points in the world coordinatesystem. Next, the scatter points are converted from the world coordinatesystem to the screen coordinate system so that the three-dimensionalgarment model may be displayed on the screen. Here, the above coordinatetransformation may further include mapping the texture coordinates ofthe scatter points to screen coordinates. Thus, the coordinateinformation of the scatter points after the coordinate transformation isdetermined according to the coordinate transformation. It should benoted here that the above-mentioned methods of coordinate transformationare known in the art, and details are not described herein.

Step 405: generating a primitive having a preset shape based on thecoordinate information of the scatter points after the coordinatetransformation.

In the present embodiment, based on the coordinate information of thescatter points after the coordinate transformation determined in step404, the above-described execution body may use the scatter points afterthe coordinate transformation as vertices, and connect a predeterminednumber of adjacent scatter points to form a primitive of a preset shape.Here, the preset shape may include, for example, a triangle, aquadrangle, a polygon, or the like. Here, primitives of one preset shapemay be generated, or primitives of a plurality of preset shapes may begenerated. Each primitive also includes connection relationships betweenthe scatter points after the coordinate transformation. The connectionrelationship includes, for example, the number of other scatter pointsconnected to each scatter point, relative coordinate information betweenthe other scatter points connected to each scatter point and the eachscatter point, and the like.

Step 406: rasterizing the primitive to obtain a fragment set of theprimitive.

In the present embodiment, for a primitive determined in step 405, theexecution body may rasterize the primitive to obtain a fragment set ofprimitive. Here, the rasterization generally includes interpolatingbetween scatter points in the primitive to obtain a plurality ofinterpolated points and interpolated point information. Each obtainedinterpolated point as well as the interpolated point information may bereferred to as a fragment. Here, the interpolation point information mayinclude, for example, color information, texture coordinate information,and the like.

Step 407: performing texture coordinate mapping on the fragment set, toobtain pixels located at the texture coordinates of the selectedthree-dimensional garment model.

In the present embodiment, based on the fragment set determined in step406, the above-mentioned execution body may determine the color valuesat the points on the three-dimensional garment model based on thetexture coordinate information and the color information of eachfragment. Thus, the above-described execution body may perform shadingprocessing on the selected three-dimensional garment model, therebyobtaining pixels at the points on the three-dimensional garment model.Here, the points on the three-dimensional garment model include both thelabeled scatter points and the interpolated points obtained by theinterpolation.

Step 408: generating the three-dimensional garment image based on theobtained pixels.

In the present embodiment, the above-mentioned execution body may renderthe three-dimensional garment model based on the pixels of the points onthe three-dimensional garment model determined in step 407, therebygenerating the three-dimensional garment image having the texture of theacquired two-dimensional garment image.

In some alternative implementations of the present embodiment, thefragment in the fragment set may also include texture materialinformation. Since the texture material of the garment presented by thetwo-dimensional garment image is rough material, ambient light (e.g.,sunlight) projected onto the surface of the garment would producediffuse reflection. The execution body may also determine the texturematerial coefficient based on the texture material information of thefragments in the fragment set, and then the execution body may simulatethe diffuse reflection light intensity of the ambient light at thepixels on the three-dimensional garment model when the environment lightis irradiated on the three-dimensional garment model. Here, the diffusereflection light intensity of the ambient light is generally the productof the texture material coefficient and the ambient light intensity. Theexecution body may further determine the relative positions of thevirtual light source and pixel points on the three-dimensional garmentmodel, based on the coordinate of the virtual light source in the screencoordinate system with the virtual light source being provided in thethree-dimensional scene. Therefore, the above-mentioned execution bodymay determine the diffuse reflection light intensity of directionallight at each pixel based on the Lambert illumination model. In theLambert illumination model, it is pointed out that the light intensityof the diffuse reflection light is only proportional to the cosine ofthe included angle between the direction of the incident light and thesurface normal vector at the reflection point. Therefore, based on theintensity of the light source, the included angle between the lightsource and the normal vector at a pixel point, and the reflectioncoefficient of the texture material at the pixel point, the diffusereflection light intensity of the directional light at the pixel pointmay be obtained. Finally, the sum of the diffuse reflected lightintensity of the ambient light at the pixel and the diffuse reflectionlight intensity of the directional light at the pixel is determined asthe illumination intensity information of the pixel. The execution bodyprocesses the obtained color values of the pixels based on the obtainedillumination intensity information of the pixel points and based on thecolor information of the light source. Here, the processing method mayinclude changing the color values of the pixel points of thethree-dimensional garment model when no light source is added thereon.The method for processing a color value may include, for example,performing a product calculation, according to weight values, on thecolor value of the color of the light source, the illumination intensityvalue, and the color value of the pixel on the three-dimensional garmentmodel when the light source has not been added thereon, and determininga calculation result as the color value at the pixel. And finally, theexecution body may generate the three-dimensional garment image based onthe processed pixels.

In some alternative implementations of the present embodiment, theabove-described execution body may also smooth the texture of thethree-dimensional garment image.

Step 409, receiving somatotype information.

In the present embodiment, the above-described execution body may alsoreceive somatotype information. Here, the somatotype information may besize information of various parts of the body, such as waistcircumference information, shoulder width information, chestcircumference information, or the like, transmitted by the user througha terminal. The somatotype information may also be body ratioinformation or the like selected by the user through a terminal.

Step 410, selecting a virtual three-dimensional model matching thesomatotype information from a preset virtual three-dimensional modelset.

In the present embodiment, based on the somatotype information receivedin step 409, the execution body may compare the size data in thesomatotype information with the body size data of the preset virtualthree-dimensional models in the preset virtual three-dimensional modelset, and select, based on the comparison result, a preset virtualthree-dimensional model in which the size data is smaller than a presetthreshold value as the virtual three-dimensional model matching theshape information.

Step 411, setting, based on a preset coordinate mapping relationshipbetween the virtual three-dimensional model and the three-dimensionalgarment model, the three-dimensional garment image onto the selectedvirtual three-dimensional model and presenting.

In the present embodiment, according to the virtual three-dimensionalmodel selected in step 410, the above-mentioned execution body may setthe three-dimensional garment image onto the selected virtualthree-dimensional model according to the coordinate mapping relationshipbetween the preset virtual three-dimensional model and thethree-dimensional garment model. Here, the pre-established coordinatemapping relationship between the virtual three-dimensional model and thethree-dimensional garment model may be a coordinate mapping relationshipbetween the virtual three-dimensional model and the three-dimensionalgarment model in the screen coordinate system. Thus, the points on thethree-dimensional garment image is mapped onto the preset virtualthree-dimensional model, and the three-dimensional garment image ispresented through the three-dimensional virtual model.

As can be seen from FIG. 4, different from the embodiment shown in FIG.2, the process of generating the three-dimensional garment image isdiscussed in more detail in the present embodiment, so that the textureof the acquired two-dimensional garment image may be more accurately setonto the selected three-dimensional model; Meanwhile, in the presentembodiment, the three-dimensional garment image is presented by usingthe preset virtual three-dimensional model, so that the user may moreintuitively view the generated three-dimensional garment image, therebyimproving the visualization effect.

Further referring to FIG. 5, as an implementation of the method shown inthe above figures, an embodiment of the present disclosure provides anapparatus for processing an image. The embodiment of the apparatuscorresponds to the embodiment of the method shown in FIG. 2. Theapparatus may be specifically applied to various electronic devices.

As shown in FIG. 5, the apparatus 500 for processing information of thepresent embodiment includes: an acquisition unit 501, a selection unit502, a labeling unit 503, a generation unit 504. The acquisition unit isconfigured to acquire a two-dimensional garment image, wherein thetwo-dimensional garment image includes a style identifier of a garment.The selection unit is configured to select a three-dimensional garmentmodel matching the style identifier from a pre-established set ofthree-dimensional garment models, wherein the three-dimensional garmentmodel includes scatter points labeled thereon. The labeling unit isconfigured to label the two-dimensional garment image with scatterpoints based on a pre-established coordinate mapping relationshipbetween the two-dimensional garment image and the three-dimensionalgarment model and the scatter points of the selected three-dimensionalgarment model. The generation unit is configured to generate athree-dimensional garment image of the acquired two-dimensional garmentimage based on the selected three-dimensional garment model and a resultof the labeling.

In the present embodiment, in the apparatus 500 for processing an image,the specific processing of the acquisition unit 501, the selection unit502, the labeling unit 503, and the generation unit 504 and thetechnical effects thereof may refer to the related description of step201, step 202, step 203, and step 204, in the corresponding embodimentof FIG. 2, respectively. The description will not be repeated here.

In some alternative implementations of the present embodiment, thegeneration unit 504 further includes a coordinate transformation subunit(not shown), configured to perform coordinate transformation on thescatter points of the acquired two-dimensional garment image, anddetermining coordinate information of the scatter points after thecoordinate transformation. A primitive generation subunit (not shown),configured to generate a primitive having a preset shape based on thecoordinate information of the scatter points after the coordinatetransformation, the primitive comprising a preset number of scatterpoints after the coordinate transformation and a connection relationshipbetween the scatter points. A processing subunit (not shown), configuredto rasterize the primitive to obtain a fragment set of the primitive,wherein a fragment in the fragment set includes a color value andtexture coordinate information. A texture coordinate mapping subunit(not shown), configured to perform texture coordinate mapping on thefragment set to obtain pixels of the selected three-dimensional garmentmodel. A generation subunit (not shown), configured to generate thethree-dimensional garment image based on the obtained pixels.

In some alternative implementations of the present embodiment, thefragment in the fragment set further comprise texture materialinformation; and the generation subunit (not shown) is furtherconfigured to: determine illumination information of the obtained pixelsbased on the texture material information and the preset light sourcecoordinate information; process the obtained pixels based on lightsource color information and the determined illumination information;generate the three-dimensional garment image based on the processedpixels.

In some alternative implementations of the present embodiment, theapparatus for processing an image is further configured to: smoothtexture of the three-dimensional garment image.

In some alternative implementations of the present embodiment, the setof three-dimensional garment models is established by: acquire a set oftwo-dimensional sample garment images, the set of two-dimensional samplegarment images including two-dimensional sample garment image sequencesof at least one style, for a two-dimensional sample garment imagesequence of each style in the two-dimensional sample garment imagesequences of at least one style, perform: extracting feature points ofthe two-dimensional sample garment image sequence; constructing afundamental matrix based on the extracted feature points; establishing athree-dimensional garment model based on the constructed fundamentalmatrix and calibration parameters of a pre-calibrated camera, whereinthe camera is a camera acquiring the two-dimensional sample garmentimage sequence; generate the set of three-dimensional garment modelsbased on the established at least one three-dimensional garment model.

In some alternative implementations of the present embodiment, theapparatus for processing an image is further configured to: receivesomatotype information; select a virtual three-dimensional modelmatching the somatotype information from a preset virtualthree-dimensional model set; set, based on a preset coordinate mappingrelationship between the virtual three-dimensional model and thethree-dimensional garment model, the three-dimensional garment imageonto the selected virtual three-dimensional model and presenting.

Referring to FIG. 6, a schematic structural diagram of a computer system600 adapted to implement a terminal device or a server of theembodiments of the present disclosure is shown. The electronic deviceshown in FIG. 6 is just an example, and should bring no limitation tothe function and usage range of embodiments of the present disclosure.

As shown in FIG. 6, the computer system 600 includes a centralprocessing unit (CPU) 601, which may execute various appropriate actionsand processes in accordance with a program stored in a read-only memory(ROM) 602 or a program loaded into a random access memory (RAM) 603 froma storage portion 608. The RAM 603 also stores various programs and datarequired by operations of the system 600. The CPU 601, the ROM 602 andthe RAM 603 are connected to each other through a bus 604. Aninput/output (I/O) interface 605 is also connected to the bus 604.

The following components are connected to the I/O interface 605: aninput portion 606 including a keyboard, a mouse etc.; an output portion607 comprising a cathode ray tube (CRT), a liquid crystal display device(LCD), a speaker etc.; a storage portion 608 including a hard disk andthe like; and a communication portion 609 comprising a network interfacecard, such as a LAN card and a modem. The communication portion 609performs communication processes via a network, such as the Internet. Adriver 610 is also connected to the I/O interface 605 as required. Aremovable medium 611, such as a magnetic disk, an optical disk, amagneto-optical disk, and a semiconductor memory, may be installed onthe driver 610, to facilitate the retrieval of a computer program fromthe removable medium 611, and the installation thereof on the storageportion 608 as needed.

In particular, according to embodiments of the present disclosure, theprocess described above with reference to the flow chart may beimplemented in a computer software program. For example, an embodimentof the present disclosure includes a computer program product, whichcomprises a computer program that is hosted in a machine-readablemedium. The computer program comprises program codes for executing themethod as illustrated in the flow chart. In such an embodiment, thecomputer program may be downloaded and installed from a network via thecommunication portion 609, or may be installed from the removeablemedium 611. The computer program, when executed by the centralprocessing unit (CPU) 601, implements the above mentionedfunctionalities as defined by the methods of the present disclosure. Itshould be noted that the computer readable medium in the presentdisclosure may be computer readable signal medium or computer readablestorage medium or any combination of the above two. An example of thecomputer readable storage medium may include, but not limited to:electric, magnetic, optical, electromagnetic, infrared, or semiconductorsystems, apparatus, elements, or a combination any of the above. A morespecific example of the computer readable storage medium may include butis not limited to: electrical connection with one or more wire, aportable computer disk, a hard disk, a random access memory (RAM), aread only memory (ROM), an erasable programmable read only memory (EPROMor flash memory), a fibre, a portable compact disk read only memory(CD-ROM), an optical memory, a magnet memory or any suitable combinationof the above. In some embodiments of the present disclosure, thecomputer readable storage medium may be any tangible medium containingor storing programs which may be used by a command execution system,apparatus or element or incorporated thereto. In some embodiments of thepresent disclosure, the computer readable signal medium may include datasignal in the base band or propagating as parts of a carrier, in whichcomputer readable program codes are carried. The propagating signal maytake various forms, including but not limited to: an electromagneticsignal, an optical signal or any suitable combination of the above. Thesignal medium that may be read by computer may be any computer readablemedium except for the computer readable storage medium. The computerreadable medium is capable of transmitting, propagating or transferringprograms for use by, or used in combination with, a command executionsystem, apparatus or element. The program codes contained on thecomputer readable medium may be transmitted with any suitable mediumincluding but not limited to: wireless, wired, optical cable, RF mediumetc., or any suitable combination of the above.

The flow charts and block diagrams in the accompanying drawingsillustrate architectures, functions and operations that may beimplemented according to the systems, methods and computer programproducts of the various embodiments of the present disclosure. In thisregard, each of the blocks in the flow charts or block diagrams mayrepresent a module, a program segment, or a code portion, said module,program segment, or code portion comprising one or more executableinstructions for implementing specified logic functions. It should alsobe noted that, in some alternative implementations, the functionsdenoted by the blocks may occur in a sequence different from thesequences shown in the figures. For example, any two blocks presented insuccession may be executed, substantially in parallel, or they maysometimes be in a reverse sequence, depending on the function involved.It should also be noted that each block in the block diagrams and/orflow charts as well as a combination of blocks may be implemented usinga dedicated hardware-based system executing specified functions oroperations, or by a combination of a dedicated hardware and computerinstructions.

The units or modules involved in embodiments of the present disclosuremay be implemented by means of software or hardware. The described unitsor modules may also be provided in a processor, for example, describedas: a processor, comprising an acquis ion unit, a selection unit, alabeling unit, and a generation unit, where the names of these units ormodules do not in some cases constitute a limitation to such units ormodules themselves. For example, the acquis ion unit may also bedescribed as “a unit for acquiring a two-dimensional garment image.”

In another aspect, some embodiments of the present disclosure furtherprovide a computer-readable storage medium. The computer-readablestorage medium may be the computer storage medium included in theapparatus in the above described embodiments, or a stand-alonecomputer-readable storage medium not assembled into the apparatus. Thecomputer-readable storage medium stores one or more programs. The one ormore programs, when executed by a device, cause the device to: acquire atwo-dimensional garment image, wherein the two-dimensional garment imageincludes a style identifier of a garment; select a three-dimensionalgarment model matching the style identifier from a pre-established setof three-dimensional garment models, wherein the three-dimensionalgarment model includes scatter points labeled thereon; label thetwo-dimensional garment image with scatter points based on apre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model;generate a three-dimensional garment image of the acquiredtwo-dimensional garment image based on the selected three-dimensionalgarment model and a result of the labeling.

The above description only provides an explanation of the preferredembodiments of the present disclosure and the technical principles used.It should be appreciated by those skilled in the art that the inventivescope of the present disclosure is not limited to the technicalsolutions formed by the particular combinations of the above-describedtechnical features. The inventive scope should also cover othertechnical solutions formed by any combinations of the above-describedtechnical features or equivalent features thereof without departing fromthe concept of the disclosure. Technical schemes formed by theabove-described features being interchanged with, but not limited to,technical features with similar functions disclosed in the presentdisclosure are examples.

What is claimed is:
 1. A method for processing an image, comprising:acquiring a two-dimensional garment image, wherein the two-dimensionalgarment image includes a style identifier of a garment; selecting athree-dimensional garment model matching the style identifier from apre-established set of three-dimensional garment models, wherein thethree-dimensional garment model includes scatter points labeled thereon;labeling the two-dimensional garment image with scatter points based ona pre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model;performing coordinate transformation on the scatter points of theacquired two-dimensional garment image, and determining coordinateinformation of the scatter points after the coordinate transformation;generating a primitive having a preset shape based on the coordinateinformation of the scatter points after the coordinate transformation,the primitive comprising a preset number of scatter points after thecoordinate transformation and a connection relationship between thescatter points; rasterizing the primitive to obtain a fragment set ofthe primitive, wherein a fragment in the fragment set includes a colorvalue and texture coordinate information; performing texture coordinatemapping on the fragment set to obtain pixels of the selectedthree-dimensional garment model; and generating the three-dimensionalgarment image based on the obtained pixels.
 2. The method according toclaim 1, wherein the connection relationship comprises a number of otherscatter points connected to each scatter point, and relative coordinateinformation between the other scatter points connected to each scatterpoint and the each scatter point.
 3. The method according to claim 2,wherein the fragment in the fragment set further comprise texturematerial information; and the generating the three-dimensional garmentimage based on the obtained pixels comprises: determining illuminationinformation of the obtained pixels based on the texture materialinformation and the preset light source coordinate information;processing the obtained pixels based on light source color informationand the determined illumination information; generating thethree-dimensional garment image based on the processed pixels.
 4. Themethod according to claim 2, wherein after the generating thethree-dimensional garment image based on the obtained pixels, the methodfurther comprises: smoothing texture of the three-dimensional garmentimage.
 5. The method according to claim 1, wherein the set ofthree-dimensional garment models is established by: acquiring a set oftwo-dimensional sample garment images, the set of two-dimensional samplegarment images including two-dimensional sample garment image sequencesof at least one style, for a two-dimensional sample garment imagesequence of each style in the two-dimensional sample garment imagesequences of at least one style, performing: extracting feature pointsof the two-dimensional sample garment image sequence; constructing afundamental matrix based on the extracted feature points; establishing athree-dimensional garment model based on the constructed fundamentalmatrix and calibration parameters of a pre-calibrated camera, whereinthe camera is a camera acquiring the two-dimensional sample garmentimage sequence; generating the set of three-dimensional garment modelsbased on the established at least one three-dimensional garment model.6. The method according to claim 1, wherein after the generating thethree-dimensional garment image of the acquired two-dimensional garmentimage, the method further comprises: receiving somatotype information;selecting a virtual three-dimensional model matching the somatotypeinformation from a preset virtual three-dimensional model set; setting,based on a preset coordinate mapping relationship between the virtualthree-dimensional model and the three-dimensional garment model, thethree-dimensional garment image onto the selected virtualthree-dimensional model and presenting.
 7. An apparatus for processingan image, the apparatus comprising: at least one processor; and a memorystoring instructions, the instructions when executed by the at least oneprocessor, causing the at least one processor to perform operations, theoperations comprising: acquiring a two-dimensional garment image,wherein the two-dimensional garment image includes a style identifier ofa garment; selecting a three-dimensional garment model matching thestyle identifier from a pre-established set of three-dimensional garmentmodels, wherein the three-dimensional garment model includes scatterpoints labeled thereon; labeling the two-dimensional garment image withscatter points based on a pre-established coordinate mappingrelationship between the two-dimensional garment image and thethree-dimensional garment model and the scatter points of the selectedthree-dimensional garment model; performing coordinate transformation onthe scatter points of the acquired two-dimensional garment image, anddetermining coordinate information of the scatter points after thecoordinate transformation; generating a primitive having a preset shapebased on the coordinate information of the scatter points after thecoordinate transformation, the primitive comprising a preset number ofscatter points after the coordinate transformation and a connectionrelationship between the scatter points; rasterizing the primitive toobtain a fragment set of the primitive, wherein a fragment in thefragment set includes a color value and texture coordinate information;and performing texture coordinate mapping on the fragment set to obtainpixels of the selected three-dimensional garment model; generating thethree-dimensional garment image based on the obtained pixels.
 8. Theapparatus according to claim 7, wherein the connection relationshipcomprises a number of other scatter points connected to each scatterpoint, and relative coordinate information between the other scatterpoints connected to each scatter point and the each scatter point. 9.The apparatus according to claim 8, wherein the fragment in the fragmentset further comprise texture material information; and the generatingthe three-dimensional garment image based on the obtained pixels isfurther configured to: determining illumination information of theobtained pixels based on the texture material information and the presetlight source coordinate information; processing the obtained pixelsbased on light source color information and the determined illuminationinformation; generating the three-dimensional garment image based on theprocessed pixels.
 10. The apparatus according to claim 8, wherein theoperations further comprise: smoothing texture of the three-dimensionalgarment image.
 11. The apparatus according to claim 7, wherein the setof three-dimensional garment models is established by: acquiring a setof two-dimensional sample garment images, the set of two-dimensionalsample garment images including two-dimensional sample garment imagesequences of at least one style, for a two-dimensional sample garmentimage sequence of each style in the two-dimensional sample garment imagesequences of at least one style, performing: extracting feature pointsof the two-dimensional sample garment image sequence; constructing afundamental matrix based on the extracted feature points; establishing athree-dimensional garment model based on the constructed fundamentalmatrix and calibration parameters of a pre-calibrated camera, whereinthe camera is a camera acquiring the two-dimensional sample garmentimage sequence; generating the set of three-dimensional garment modelsbased on the established at least one three-dimensional garment model.12. The apparatus according to claim 7, wherein the operations furthercomprise: receiving somatotype information; selecting a virtualthree-dimensional model matching the somatotype information from apreset virtual three-dimensional model set; setting, based on a presetcoordinate mapping relationship between the virtual three-dimensionalmodel and the three-dimensional garment model, the three-dimensionalgarment image onto the selected virtual three-dimensional model andpresenting.
 13. A non-transitory computer readable storage medium,storing a computer program thereon, wherein the program, when executedby a processor, implements operations, the operations comprise:acquiring a two-dimensional garment image, wherein the two-dimensionalgarment image includes a style identifier of a garment; selecting athree-dimensional garment model matching the style identifier from apre-established set of three-dimensional garment models, wherein thethree-dimensional garment model includes scatter points labeled thereon;labeling the two-dimensional garment image with scatter points based ona pre-established coordinate mapping relationship between thetwo-dimensional garment image and the three-dimensional garment modeland the scatter points of the selected three-dimensional garment model;performing coordinate transformation on the scatter points of theacquired two-dimensional garment image, and determining coordinateinformation of the scatter points after the coordinate transformation;generating a primitive having a preset shape based on the coordinateinformation of the scatter points after the coordinate transformation,the primitive comprising a preset number of scatter points after thecoordinate transformation and a connection relationship between thescatter points; rasterizing the primitive to obtain a fragment set ofthe primitive, wherein a fragment in the fragment set includes a colorvalue and texture coordinate information; performing texture coordinatemapping on the fragment set to obtain pixels of the selectedthree-dimensional garment model; and generating the three-dimensionalgarment image based on the obtained pixels.
 14. The medium according toclaim 13, wherein the connection relationship comprises a number ofother scatter points connected to each scatter point, and relativecoordinate information between the other scatter points connected toeach scatter point and the each scatter point.
 15. The medium accordingto claim 14, wherein the fragment in the fragment set further comprisetexture material information; and the generating the three-dimensionalgarment image based on the obtained pixels comprises: determiningillumination information of the obtained pixels based on the texturematerial information and the preset light source coordinate information;processing the obtained pixels based on light source color informationand the determined illumination information; generating thethree-dimensional garment image based on the processed pixels.
 16. Themedium according to claim 14, wherein after the generating thethree-dimensional garment image based on the obtained pixels, the methodfurther comprises: smoothing texture of the three-dimensional garmentimage.
 17. The medium according to claim 13, wherein the set ofthree-dimensional garment models is established by: acquiring a set oftwo-dimensional sample garment images, the set of two-dimensional samplegarment images including two-dimensional sample garment image sequencesof at least one style, for a two-dimensional sample garment imagesequence of each style in the two-dimensional sample garment imagesequences of at least one style, performing: extracting feature pointsof the two-dimensional sample garment image sequence; constructing afundamental matrix based on the extracted feature points; establishing athree-dimensional garment model based on the constructed fundamentalmatrix and calibration parameters of a pre-calibrated camera, whereinthe camera is a camera acquiring the two-dimensional sample garmentimage sequence; generating the set of three-dimensional garment modelsbased on the established at least one three-dimensional garment model.18. The medium according to claim 13, wherein after the generating thethree-dimensional garment image of the acquired two-dimensional garmentimage, the method further comprises: receiving somatotype information;selecting a virtual three-dimensional model matching the somatotypeinformation from a preset virtual three-dimensional model set; setting,based on a preset coordinate mapping relationship between the virtualthree-dimensional model and the three-dimensional garment model, thethree-dimensional garment image onto the selected virtualthree-dimensional model and presenting.